//
//  ZLBaseTableViewController.swift
//  新浪微博
//
//  Created by 朱玉龙 on 9/26/16.
//  Copyright © 2016 朱玉龙. All rights reserved.
//

import UIKit

let login = ZLOAthorViewModel.shareOAthor.login

class ZLBaseTableViewController: UITableViewController {

   lazy var backView:ZLBackView = ZLBackView()
    
    override func loadView() {
        
        
        if login {
            
            super.loadView()
            
        } else {
            
           view = backView
            
            backView.delegate = self
            
        }
        
    }
    
    
    override func viewDidLoad() {
        super.viewDidLoad()

        
    }

    override func numberOfSections(in tableView: UITableView) -> Int {
        return 1
    }
    
}
//登录注册
extension ZLBaseTableViewController: ZLBackViewDelegate {
 
    func willLogin() {
        
        presentController()
    }
    
    func willRegiser() {
      
        print("注册去")
    }
    
    
    private func presentController() {
        
        let vc = ZLOAthorController()
        
        let nv = UINavigationController(rootViewController: vc)
        
        present(nv, animated: true, completion: nil)
    }
    
    
}


